<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <link rel="stylesheet" href="../css/base.css">
  <link rel="stylesheet" href="../css/index.css">
  <link rel="stylesheet" href="../css/list.css">
  <link rel="stylesheet" href="../css/layui1.css">
  <link rel="stylesheet" href="../css/swiper-bundle.min.css">
  <script src="../js/swiper-bundle.min.js"></script>

  <script src="../js/tool.js"></script>
  <script src="../js/layui1.js"></script>
  <style>
    h1 {
      position: fixed;
      top: 0px;
      left: 0px;
      z-index: 999;
    }

    #backtotop {
      width: 40px;
      height: 40px;
      background-color: rgba(255, 69, 0, 0.5);
      position: fixed;
      right: 30px;
      bottom: 30px;
      cursor: pointer;
      text-align: center;
      line-height: 50px;
      font-weight: lighter;
      color: white;
      z-index: 9999;
    }

    #backtotop:hover {
      background-color: orangered;
    }
  </style>
</head>

<body>
  <h1>
    商品列表
    <p class="active">
      <a href="./cart.html">去到购物车</a>
      <a href="./home.html">回到首页</a>
    </p>
  </h1>
  <div id="backtotop">^</div>
  <!-- 轮播 -->
  <!-- <div class="layui-carousel" id="test1">
    <div carousel-item class="box1">
      <div></div>
      <div></div>
      <div></div>
      <div></div>
      <div></div>
    </div>
  </div> -->
  <div class="swiper mySwiper">
    <div class="swiper-wrapper" id="box1">
      <!-- <div class="swiper-slide">Slide 1</div>
      <div class="swiper-slide">Slide 2</div>
      <div class="swiper-slide">Slide 3</div>
      <div class="swiper-slide">Slide 4</div>
      <div class="swiper-slide">Slide 5</div>
      <div class="swiper-slide">Slide 6</div>
      <div class="swiper-slide">Slide 7</div>
      <div class="swiper-slide">Slide 8</div>
      <div class="swiper-slide">Slide 9</div> -->
    </div>
    <div class="swiper-button-next"></div>
    <div class="swiper-button-prev"></div>
    <div class="swiper-pagination"></div>
  </div>

  <script>
    //swiper轮播
    var swiper = new Swiper(".mySwiper", {
      cssMode: true,
      navigation: {
        nextEl: ".swiper-button-next",
        prevEl: ".swiper-button-prev",
      },
      pagination: {
        el: ".swiper-pagination",
      },
      keyboard: true,
      autoplay: true,
      loop: true,
      observer:true
    });
  </script>

  <div class="filterBox container">
    <div class="cateBox box">
      <p>分类 : </p>
      <ul>
        <!-- <li class='cateItem active'>全部</li>   -->

        <!-- <li class='cateItem active'>全部</li>  <li class='cateItem'>${item}</li>   -->
      </ul>
    </div>
    <div class="saleBox box">
      <p>筛选 : </p>
      <ul>
        <li class="saleItem active" data-sale="">全部</li>
        <li class="saleItem" data-sale="hot">热销</li>
        <li class="saleItem" data-sale="sale">折扣</li>
      </ul>
    </div>
    <div class="numberBox box">
      <p>折扣 : </p>
      <ul>
        <li class="numberItem active" data-number="10">全部</li>
        <li class="numberItem" data-number="5">5</li>
        <li class="numberItem" data-number="6">6</li>
        <li class="numberItem" data-number="7">7</li>
        <li class="numberItem" data-number="8">8</li>
        <li class="numberItem" data-number="9">9</li>
      </ul>
    </div>
    <div class="searchBox box">
      <p>搜索 : </p>
      <input class="search" type="text">
    </div>
    <p>排序 : </p>
    <div class="sortBox box">
      <ul>
        <li class="sortItem active" data-type="id" data-method="ASC">综合升序</li>
        <li class="sortItem" data-type="id" data-method="DESC">综合降序</li>
        <li class="sortItem" data-type="price" data-method="ASC">价格升序</li>
        <li class="sortItem" data-type="price" data-method="DESC">价格降序</li>
        <li class="sortItem" data-type="sale" data-method="ASC">折扣升序</li>
        <li class="sortItem" data-type="sale" data-method="DESC">折扣降序</li>
      </ul>
    </div>
  </div>

  <div class="pagination container">
    <span class="prev disable" id="prev">上一页</span>
    <span class="total">1 / 100</span>
    <span class="next" id="next">下一页</span>
    <select>
      <option value="12">12</option>
      <option value="16">16</option>
      <option value="20">20</option>
      <option value="24">24</option>
    </select>
  </div>

  <ul class="list container">
    <!-- <li data-goods_id=${item.goods_id}>
                    <div class="show" >
                        <img src="${item.img_big_logo}" alt="">
                        ${item.is_hot?'<span class="hot">热销</span>':''}
                        ${item.is_sale?'<span class="sale">折扣</span>':''}
                    </div> 
                    <p class="title">${item.title}</p>
                    <p class="price">
                        <span class="current">￥ ${item.current_price}</span>
                        <span class="origin">￥ ${item.price}</span>
                    </p>
                    <button data-goods_id=${item.goods_id}>加入购物车</button>
                    </li>-->
  </ul>
  <script src="../js/list.js"></script>

  <!-- 组件轮播 -->
  <!-- <script>
    layui.use('carousel', function () {
      var carousel = layui.carousel;
      //建造实例
      carousel.render({
        elem: '#test1'
        , width: '100%' //设置容器宽度
        , height: '500px'
        , arrow: 'always' //始终显示箭头
        , autoplay: 'true'
        //,anim: 'updown' //切换动画方式
      });
    });
  </script> -->

  <!-- 回到顶部 -->
  <script>
    var backtotop = document.getElementById('backtotop');
    var time = null;
    backtotop.onclick = function () {
      time = setInterval(function () {
        // clearInterval(time);
        document.documentElement.scrollTop -= 80;
        console.log('my name');
        if (document.documentElement.scrollTop <= 60) {
          clearInterval(time);
        }
      }, 20)
    }




  </script>
</body>

</html>